﻿#if SRP_URP
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

namespace GameToolkit
{
    public struct CustomPostProcessPassID
    {
        public int passIndex;
        public int renderQ;
        public RenderPassEvent renderEvent;
        public CustomPostProcessPassID(int pid, RenderPassEvent renderEvent, int renderQ = 0)
        {
            this.passIndex = pid;
            this.renderQ = renderQ;
            this.renderEvent = renderEvent;
        }
    }

    [System.Obsolete("将不再支持，使用 BaseVolumeComponent 系统替换", false)]
    public abstract class CustomVolumeComponent : VolumeComponent, IPostProcessComponent
    {
        public abstract IList<CustomPostProcessPassID> GetPasses();
        /// <summary>
        /// 激活
        /// </summary>
        /// <param name="pass"></param>
        public abstract void OnBecomeEnabled(CustomPostProcessing pass);

        /// <summary>
        /// 关闭
        /// </summary>
        /// <param name="pass"></param>
        public abstract void OnBecomeDisabled(CustomPostProcessing pass);

        public virtual bool IsActive() { return active; }

        public virtual bool IsTileCompatible() { return true; }

        public virtual void ConfigPass(URPPostProcessPass pass, CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { }

        public virtual void ExecutePass(URPPostProcessPass pass, ScriptableRenderContext context, ref RenderingData renderingData) { }

        public virtual void FrameCleanup(CommandBuffer cmd) { }

    }
}
#endif